﻿using System;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
using System.Security.Permissions;

using System.Data;
using System.Net;
using System.IO;
using System.Web;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HttpProc;

namespace QQForm
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //QQHttpRequest qqHttpRequest = new QQHttpRequest();
            //qqHttpRequest.StrCookie = webBrowser1.Document.Cookie;
            //qqHttpRequest.OpenRequest("http://ptlogin2.qq.com/login", "http://xiaoyou.qq.com", "u=8627520&p=0B3C2310EE5772157F3EDBB796BA19D9&verifycode="+textBox2.Text+"&aid=15000102&u1=http%3A%2F%2Fxiaoyou.qq.com%2Findex.php%3Fmod%3Dlogin&fp=&h=1&ptredirect=1&ptlang=0&from_ui=1&dumy=");
            HttpProc.WebClient client = new HttpProc.WebClient();
            client.Cookie = webBrowser1.Document.Cookie;
            client.Encoding = System.Text.Encoding.Default;//默认编码方式，根据需要设置其他类型
            string pwd = QQMD5.getMd5Hash2(QQMD5.getMd5Hash("Lxin0420").ToUpper() + this.textBox2.Text.ToUpper()).ToUpper();
            client.OpenRead("http://ptlogin2.qq.com/login", "u=8627520&p="+pwd+"&verifycode=" + textBox2.Text + "&aid=15000102&u1=http%3A%2F%2Fxiaoyou.qq.com%2Findex.php%3Fmod%3Dlogin&fp=&h=1&ptredirect=1&ptlang=0&from_ui=1&dumy=");//普通get请求
            //MessageBox.Show(client.RespHtml);//获取返回的网页源代码


            //webBrowser1.DocumentText = client.RespHtml;
            webBrowser1.Url = new Uri("http://xiaoyou.qq.com/favicon.ico?1255459098");
            textBox1.Text = webBrowser1.Document.Cookie;

        }

       

    }





}
